{% extends "blog/base.html" %}
{% load static wagtailcore_tags wagtailimages_tags blogapp_tags wagtailmd%}

{% block title %}{{ self.title }} | {{ blog_page.title }}{% endblock title %}
{% block meta_title %}{% if self.seo_title %}{{ self.seo_title }}{% else %}{{ self.title }}{% endif %}{% endblock meta_title %}
{% block meta_description %}{% if self.search_description %}{{ self.search_description }}{% else %}{{ self.body|striptags|truncatewords:20 }}{% endif %}{% endblock meta_description %}

{% block content %}

{% with blocks=self.body %}

    {% for block in blocks %}
        {% if block.block_type == 'heading' %}
            <h2>{{ block.value }}</h2>
        {% else %}
           <section class="block-{{ block.block_type }}">
               {{ block }}
           </section>
        {% endif %}
    {% endfor %}

{% endwith %}

{% endblock %}
